package tech.aistar.service.impl.registerAndLoginService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tech.aistar.entity.User.Register;
import tech.aistar.entity.authordis.UserTable;
import tech.aistar.mapper.userLoginAndRegister.UserRegister;
import tech.aistar.service.registerAndLogin.IUserRegisterService;


/**
 * Created by lenovo on 2019/9/27.
 */
@Service
@Transactional
public class UserRegisterServiceImpl implements IUserRegisterService {
    @Autowired
    private UserRegister userRegister;




    @Override
    public UserTable findByPhone(String phone) {
        UserTable user = userRegister.findByPhone(phone);
        return user;
    }

    @Override
    public void insert(String phoneNumber, String password, String email,String ver_code) {
        userRegister.insert(phoneNumber,password,email,ver_code);

    }

    @Override
    public Register findByCode(String Code, String phoneNumber) {
        Register user = userRegister.findByCode(Code,phoneNumber);
        return user;
    }

    @Override
    public void insertuser(String username,String phoneNumber, String password) {
        userRegister.insertuser(username,phoneNumber,password);
    }

    @Override
    public void insertNotes(Integer user_id) {
        userRegister.insertNotes(user_id);
    }

    @Override
    public Integer findId(String phone) {
        Integer user = userRegister.findId(phone);
        return user;
    }
}
